Skip to content

Log the usage-reporting notice every run when there is no home directory - #77

Merged
dmccoystephenson merged 2 commits into
mainfrom
feature/notice-without-home
Nov 18, 2026
Merged

dmccoystephenson merged 2 commits into
mainfrom
feature/notice-without-home

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • UsageReportingService now logs the usage-reporting notice on every run when there is no usable home directory (user.home unset or blank). Previously showFirstRunNoticeOnce() returned early when the marker path was null, while start() still sent the startup event, so events were reported with no notice ever shown, contrary to README.md and CONFIG.md.
  • The notice text is pulled into a single logNotice() helper used by both paths; the message itself is unchanged.
  • UsageReportingServiceTest: the no-home test (renamed to withoutAHomeDirectoryTheNoticeIsLoggedEveryRunAndNoInstallationIdIsMadeUp) now asserts the notice is logged on the first run and again on a second run; a new disabledWithoutAHomeDirectoryShowsNoNotice confirms the opt-out still suppresses it.
  • README.md and CONFIG.md describe the no-home case (notice every run; no install tag unless TRACE_INSTALL_ID is set); CHANGELOG.md has a Fixed entry.

Test plan

  • mvn test: 236 tests run, 0 failures, 1 skipped (pre-existing skip)
  • Regression check: with the src/main change stashed, withoutAHomeDirectoryTheNoticeIsLoggedEveryRunAndNoInstallationIdIsMadeUp fails (expected: <1> but was: <0>); with it restored, it passes
  • CI green on the PR head

Closes #75

Deferred

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

dmccoystephenson and others added 2 commits November 17, 2026 18:49
With user.home unset or blank there is no marker path, and the notice
was skipped while the startup and backup-completed events were still
sent. Log it on every run instead, and describe the case in README.md
and CONFIG.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric:

  • Scope: PASS — all 5 files serve Usage reporting runs without the first-run notice when there is no usable home directory #75: the service fix, its test, and the README/CONFIG/CHANGELOG descriptions of the no-home case.
  • Tests-new: PASS — the new private helper logNotice() is exercised by both notice tests; no new public methods were added.
  • Tests-fix: PASS — with the src/main change stashed, withoutAHomeDirectoryTheNoticeIsLoggedEveryRunAndNoInstallationIdIsMadeUp failed (expected: <1> but was: <0>). With the change restored, it passed.
  • Sibling structure: PASS — no new files were added; the new test follows the class's existing descriptive naming (this file does not use test<Method>_<Scenario>).
  • Sibling renames: PASS — the renamed test has no paired sibling.
  • Docs: FAIL→fixed — the earlier [Unreleased] entry from Test UsageReportingService's value handling and no-home path #76 still said the no-home path shows "no first-run notice". That was corrected in a follow-up commit. README.md and CONFIG.md now describe the no-home case. COMMANDS.md and USER_GUIDE.md do not mention the notice marker, so they need no change.
  • Issue resolution: PASS — this takes the issue's preferred option (log the notice every run when there is no marker) and updates the test the issue named.
  • CI: PASS — build and docker-build are green on the head commit (run 44218877252).
  • Config-doc parity: PASS — no property keys were added or changed.
  • Command-doc parity: PASS — no flags, system properties or endpoints were added.
  • Package placement: PASS — no new classes.
  • No credential leakage: PASS — the notice text is unchanged and carries no key or token.

src/main/java/com/github/backup/UsageReportingService.java:158 — note: the comment "shown every run rather than never" records the tradeoff the issue weighed. Repeating an INFO line on hosts without user.home was accepted as better than reporting with no notice.

Ready to merge: mvn test ran 236 tests with 0 failures locally, and CI is green.

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 477fc50 into main Nov 18, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/notice-without-home branch November 18, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usage reporting runs without the first-run notice when there is no usable home directory

1 participant